package com.photoeditor.demo.util.gl.util;

import com.android.gl.materials.Material;
import com.android.gl.materials.methods.DiffuseMethod;
import com.android.gl.materials.textures.ATexture;
import com.android.gl.materials.textures.CubeMapTexture;

/**
 * Created by wecut-simon on 2017/10/2.
 */

public class MaterialFactory {

    public final static int MATERIAL_DEFAULT = 0;
    public final static int MATERIAL_SKY_CUBE = 1;
    public final static int MATERIAL_FROST_CUBE = 2;

    public static Material getCubeMaterial(int[] resourceIds) {
        Material cubeMapMaterial = new Material();
        cubeMapMaterial.enableLighting(true);
        cubeMapMaterial.setDiffuseMethod(new DiffuseMethod.Lambert());
        try {
            CubeMapTexture envMap = new CubeMapTexture("monkeyCubeMap",
                    resourceIds);
            envMap.isEnvironmentTexture(true);
            cubeMapMaterial.addTexture(envMap);
            cubeMapMaterial.setColorInfluence(0);
        } catch (ATexture.TextureException e) {
            e.printStackTrace();
        }
        return cubeMapMaterial;
    }
}
